import axios from './request'
// 获取用户列表
export const getUsersApi = (data) => axios.get('/users/user', {params: data})
// 添加用户
export const addUserApi = (data) => axios.post('/users/user', data)
// 修改用户状态
export const stateChangeApi = ({_id, mg_state}) => axios.patch('/users/user/state/'+_id, {mg_state})
// 删除用户
export const delUserApi = (_id) => axios.delete('/users/user/'+_id)
// 修改用户
export const editUserApi = ({_id,email, tel, birth}) => axios.patch('/users/user/'+_id,{email, tel, birth})
// 获取角色列表
export const getRoleAPI = () => axios.get('/users/roles')
// 给用户分配角色
export const setRolesApi = ({_id, role_id}) => axios.patch('/users/setRoles/'+_id, {role_id})